package com.caine.order.feign;

import com.caine.common.entity.R;
import com.caine.order.entity.Goods;
import com.caine.order.feign.factory.GoodFeignServiceFallbackFactory;
import com.caine.order.vo.OrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;

import java.math.BigDecimal;

/**
 * @Author: CaineZhu
 * @Description:
 * @Date: Created in 18:04 2021/1/4
 * @Modified By:
 */
@Component
@FeignClient(name = "goods-service", fallbackFactory = GoodFeignServiceFallbackFactory.class)
public interface IGoodFeignService {

    @RequestMapping("goods/getStock")
    BigDecimal getStock(OrderVO vo);

    @RequestMapping("goods/getGoods")
    Goods getGoodsDetail(OrderVO vo);

    @RequestMapping("goods/getGoodsList")
    R getGoodsList(String goodsName);

    @RequestMapping("goods/reduceStock")
    boolean reduceStock(OrderVO vo);
}
